<?php

class PdoConnect {

    protected $pdo;

    public function __construct() {
        
    }

    public function open() {
        try {
            $util = "root";
            $pass = "";
            $strConnection = 'mysql:host=localhost;dbname=ufc';
            $arrExtraParam = array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8");
            $this->pdo = new PDO($strConnection, $util, $pass, $arrExtraParam);
            $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        } catch (PDOException $e) {
            $msg = 'ERREUR PDO dans ' . $e->getFile() . ' L.' . $e->getLine() . ' : ' . $e->getMessage();
            die($msg);
        }
    }

    public function close() {
        
    }

}
